home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((3333NNNN)))) ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((3333NNNN))))
-
-
-
- NNNNAAAAMMMMEEEE
- gethostbyname, gethostbyname_r, gethostbyaddr, gethostbyaddr_r,
- gethostent, gethostent_r, fgethostent, fgethostent_r, sethostent,
- endhostent, herror, hstrerror - get network host entry
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssoooocccckkkkeeeetttt....hhhh>>>>
- ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeettttiiiinnnneeeetttt////iiiinnnn....hhhh>>>>
- ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeettttddddbbbb....hhhh>>>>
-
- eeeexxxxtttteeeerrrrnnnn iiiinnnntttt hhhh____eeeerrrrrrrrnnnnoooo;;;;
-
- ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee))));;;;
-
- ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee____rrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****hhhheeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee,,,, iiiinnnntttt ****hhhh____eeeerrrrrrrrnnnnoooopppp))));;;;
-
- ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****ggggeeeetttthhhhoooossssttttbbbbyyyyaaaaddddddddrrrr((((ccccoooonnnnsssstttt vvvvooooiiiidddd ****aaaaddddddddrrrr,,,, ssssoooocccckkkklllleeeennnn____tttt aaaaddddddddrrrrlllleeeennnn,,,, iiiinnnntttt ttttyyyyppppeeee))));;;;
-
- ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****ggggeeeetttthhhhoooossssttttbbbbyyyyaaaaddddddddrrrr____rrrr((((ccccoooonnnnsssstttt vvvvooooiiiidddd ****aaaaddddddddrrrr,,,, ssssiiiizzzzeeee____tttt aaaaddddddddrrrrlllleeeennnn,,,, iiiinnnntttt ttttyyyyppppeeee,,,, ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****hhhheeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee,,,, iiiinnnntttt ****hhhh____eeeerrrrrrrrnnnnoooopppp))));;;;
-
- ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****ggggeeeetttthhhhoooosssstttteeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****ggggeeeetttthhhhoooosssstttteeeennnntttt____rrrr((((ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****hhhheeeennnntttt,,,, cccchhhhaaaarrrr bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****ffffggggeeeetttthhhhoooosssstttteeeennnntttt((((FFFFIIIILLLLEEEE ****ffff))));;;;
-
- ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****ffffggggeeeetttthhhhoooosssstttteeeennnntttt____rrrr((((FFFFIIIILLLLEEEE ****ffff,,,, ssssttttrrrruuuucccctttt hhhhoooosssstttteeeennnntttt ****hhhheeeennnntttt,,,, cccchhhhaaaarrrr bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
-
- vvvvooooiiiidddd sssseeeetttthhhhoooosssstttteeeennnntttt((((iiiinnnntttt ssssttttaaaayyyyooooppppeeeennnn))));;;;
-
- vvvvooooiiiidddd eeeennnnddddhhhhoooosssstttteeeennnntttt((((vvvvooooiiiidddd))));;;;
-
- vvvvooooiiiidddd hhhheeeerrrrrrrroooorrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ssssttttrrrriiiinnnngggg))));;;;
-
- cccchhhhaaaarrrr ****hhhhssssttttrrrreeeerrrrrrrroooorrrr((((iiiinnnntttt eeeerrrrrrrr))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _g_e_t_h_o_s_t_b_y_n_a_m_e, _g_e_t_h_o_s_t_b_y_a_d_d_r and their reentrant counterpoints each
- return a pointer to a _h_o_s_t_e_n_t data structure describing an Internet host
- referenced by name or by address, respectively. This structure contains
- either the information obtained from broken-out fields from a line in
- /_e_t_c/_h_o_s_t_s. or some other back-end hosts database.
-
- struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
- };
- #define h_addr h_addr_list[0] /* address, for backward
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((3333NNNN)))) ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((3333NNNN))))
-
-
-
- compatibility */
-
- The members of this structure are:
-
- h_name Official name of the host.
-
- h_aliases A zero terminated array of alternate names for the host.
-
- h_addrtype The type of address being returned; currently always
- AF_INET.
-
- h_length The length, in bytes, of the address.
-
- h_addr_list A zero terminated array of network addresses for the host.
- Host addresses are returned in network byte order.
-
- h_addr The first address in h_addr_list; this is for backward
- compatibility.
-
- The _n_a_m_e argument to _g_e_t_h_o_s_t_b_y_n_a_m_e is a character string containing an
- Internet hostname or an Internet address in standard dot notation (see
- _i_n_e_t(3N)). If the name contains no dot, and if the environment variable
- HOSTALIASES contains the name of an alias file, the alias file is first
- searched for an alias matching the input name. See _h_o_s_t_n_a_m_e(5) for the
- alias file format. The _a_d_d_r argument to _g_e_t_h_o_s_t_b_y_a_d_d_r points to a buffer
- containing a 32-bit Internet host address in network byte order. _a_d_d_r_l_e_n
- contains the address length in bytes; it should be set to sizeof(struct
- in_addr). _t_y_p_e specifies the address family and should be set to
- AF_INET.
-
- The _g_e_t_h_o_s_t_b_y_n_a_m_e and _g_e_t_h_o_s_t_b_y_a_d_d_r routines only parse /_e_t_c/_h_o_s_t_s format
- configuration files. An external data supplier nsd(1M) may be used to
- provide data from another source such as the Domain Name Service daemon
- named, or the NIS databases.
-
- An administrator may specify a default ordering of the services in the
- nsd configuration file /_e_t_c/_n_s_s_w_i_t_c_h._c_o_n_f.
-
- When using the Domain Name Server, _g_e_t_h_o_s_t_b_y_n_a_m_e searches for the named
- host in the current domain and its parents unless the name ends in a dot.
- See _h_o_s_t_n_a_m_e(5) for the domain search procedure. Also when using the
- name server, _g_e_t_h_o_s_t_b_y_n_a_m_e restricts the length of each subdomain name in
- a hostname to at most 63 characters.
-
- When nsd is running, _g_e_t_h_o_s_t_e_n_t obtains the next entry in the
- _h_o_s_t_s._b_y_a_d_d_r table. _s_e_t_h_o_s_t_e_n_t and _e_n_d_h_o_s_t_e_n_t reset the pointer into the
- map to the beginning.
-
- If nsd is not running, _g_e_t_h_o_s_t_e_n_t reads the next line of /_e_t_c/_h_o_s_t_s,
- opening the file if necessary. _s_e_t_h_o_s_t_e_n_t opens and rewinds the file.
- If the _s_t_a_y_o_p_e_n flag is non-zero, the file is not closed after each call
- to _g_e_t_h_o_s_t_b_y_n_a_m_eor_g_e_t_h_o_s_t_b_y_a_d_d_r. _e_n_d_h_o_s_t_e_n_t closes the file.
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((3333NNNN)))) ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((3333NNNN))))
-
-
-
- The routines fgethostent and fgethostent_r will return the next line from
- the supplied file broken out into a hostent structure. This file must be
- of the same format as /_e_t_c/_h_o_s_t_s .
-
- The routines gethostbyname, gethostbyaddr, gethostent, and fgethostent
- all return pointers to data in a static space. Reentrant versions of
- each of these are supplied as gethostbyname_r, gethostbyaddr_r,
- gethostent_r and fgethostent_r. These routines parse the results into
- passed in space. They each have extra arguments for an address to a
- struct hostent structure and a flat buffer.
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Error return status from _g_e_t_h_o_s_t_b_y_n_a_m_e and _g_e_t_h_o_s_t_b_y_a_d_d_r is indicated by
- return of a null (0) pointer. The global integer _h__e_r_r_n_o can then be
- checked to see whether this is a temporary failure or an invalid or
- unknown host. The routine _h_e_r_r_o_r can be used to print an error message
- to file descriptor 2 (standard error) describing the failure. If its
- argument _s_t_r_i_n_g is non-NULL, it is printed, followed by a colon and a
- space. The error message is printed with a trailing newline. To
- simplify variant formatting of messages, _h_s_t_r_e_r_r_o_r takes an error number
- (typically _h__e_r_r_n_o) and returns the corresponding message string.
-
- _h__e_r_r_n_o can have the following values:
-
- HOST_NOT_FOUND No such host is known.
-
- TRY_AGAIN This is usually a temporary error and means that the
- local server did not receive a response from an
- authoritative server. A retry at some later time may
- succeed.
-
- NO_RECOVERY Some unexpected server failure was encountered. This is
- a non-recoverable error.
-
- NO_DATA The requested name is valid but does not have an IP
- address; this is not a temporary error. This means that
- the name is known to the name server but there is no
- address associated with this name. Another type of
- request to the name server using this domain name results
- in an answer; for example, a mail-forwarder can be
- registered for this domain.
-
- NNNNOOOOTTTTEEEE
- The Mips ABI specifies nothing but local files so applications which wish
- to use anything else must compile with libc prior to libnsl in the
- library list.
-
- When nsd is running changes to the local host file may not be noticed by
- gethostent() until the enumeration cache file has timed out.
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((3333NNNN)))) ggggeeeetttthhhhoooossssttttbbbbyyyynnnnaaaammmmeeee((((3333NNNN))))
-
-
-
- FFFFIIIILLLLEEEESSSS
- /etc/hosts /etc/nsswitch.conf
- /etc/resolv.conf contains addresses of remote name servers
-
- EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
- HOSTALIASES contains hostname aliases
- getaddrinfo(3), getnameinfo(3), getipnodebyname(3), named(1M), nsd(1N),
- gethostent(3N), resolver(3N), hosts(4), resolver(4), hostname(5).
-
- _I_R_I_X _N_e_t_w_o_r_k _P_r_o_g_r_a_m_m_i_n_g _G_u_i_d_e
-
- _I_R_I_X _A_d_m_i_n: _N_e_t_w_o_r_k_i_n_g _a_n_d _M_a_i_l
-
- BBBBUUUUGGGGSSSS
- Only the Internet address format is currently understood.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-